﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Manage.aspx.cs" Inherits="Enterprise.UI.Web.Modules.Vote.Manage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" type="text/css" href="../../Styles/css/ssec-form.css" />
    <link rel="stylesheet" type="text/css" href="../../Styles/css/gridview.css" />
    <script charset="utf-8" src="../../kindeditor-4.1.1/kindeditor.js" type="text/javascript"></script>
    <script charset="utf-8" src="../../kindeditor-4.1.1/lang/zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#tb_Content', { uploadJson: '/kindeditor-4.1.1/upload/upload_json.ashx' });
        });
        function openlist() {
            $('#rcv_users').window('open');
        }
        function closelist() {
            //关闭窗口
            $('#rcv_users').window('close');
            //获取所有选中的节点的子节点
            var node = $('#tt2').tree('getChecked');
            if (node) {
                var children = $('#tt2').tree('getChecked', node.target);
            } else {
                var children = $('#tt2').tree('getChecked');
            }
            var s = '';
            var c = 0;
            for (var i = 0; i < children.length; i++) {
                var v = children[i].id.toString();
                if (v.indexOf("d-") < 0) {
                    s += children[i].id + ',';
                    c++;
                }
            }
            $('#rcvuser_count').text(c);
            $('#rcv_users_value').attr('value', s);
            //开发时请注释alert
            //alert('选中的人员id:'+s);
        }
        $(function () {
            //初始化签收人个数
            var u = $('#rcv_users_value').val();
            if (u) {
                $('#rcvuser_count').text(u.split(',').length);
            }
            else
                $('#rcvuser_count').text(0);
            jQuery.ajaxSetup({ cache: false })
            $('#tt2').tree({
                lines: true,
                checkbox: true,
                url: '/Modules/Json/UserList.aspx?selected=' + $('#rcv_users_value').val(),
                onClick: function (node) {
                    $(this).tree('toggle', node.target);
                    //alert('you click '+node.text);
                },
                onContextMenu: function (e, node) {
                    e.preventDefault();
                    $('#tt2').tree('select', node.target);
                    $('#mm').menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    });
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPH" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="vDaohangtiaoHolder module">
        <div class="vDaohangtiao">
            <ul>
                <li class="first">
                    <a href="/index.aspx" title="首页">首页</a>
                </li>
                <li class="last">网上调查
                </li>
            </ul>
        </div>
    </div>
    <Ent:HeadMenuWeb ID="HeadMenu1" runat="server">
        <Ent:HeadMenuButtonItem ButtonIcon="back.gif" ButtonName="返回" ButtonPopedom="New"
            ButtonUrl="Index.aspx" ButtonUrlType="Href" />
    </Ent:HeadMenuWeb>
    <div id="contents" class="ssec-form">
        <div class="ssec-group ssec-group-hasicon">
            <img src="../../easyui1.2.6/themes/icons/application.png" alt="" /><span>发起调查</span>
        </div>
        <ul>
            <li>
                <div class="ssec-label">
                    标题： <span style="color: red; font-weight: bold;">*</span>
                </div>
            </li>
            <li>
                <div class="ssec-text large">
                    <asp:TextBox ID="tb_Title" runat="server" CssClass="ssec-text-field easyui-validatebox"
                        required="true"></asp:TextBox>
                </div>
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    有效期 ： <span style="color: red; font-weight: bold;">*</span>
                </div>
            </li>
            <li>
                <div class="ssec-text xsmall">
                    <asp:TextBox ID="tb_EndTime" runat="server" CssClass="easyui-datebox" Width="180"></asp:TextBox>
                </div>
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    调查范围：
                </div>
            </li>
            <li>
                <asp:HiddenField ID="rcv_users_value" runat="server" ClientIDMode="Static" />
                <a href="#" onclick="openlist();">人员列表</a>  |  已选择<span id="rcvuser_count"></span>
                人
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    说明： <span style="color: red; font-weight: bold;">*</span>
                </div>
            </li>
            <li>
                <asp:TextBox ID="tb_Content" ClientIDMode="Static" runat="server" CssClass="easyui-validatebox"
                    TextMode="MultiLine" Height="100" required="true" Width="532"></asp:TextBox>
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    选项： <span style="color: red; font-weight: bold;">*</span>
                </div>
            </li>
            <li>
                <div>
                    <table cellpadding="0" cellspacing="0" border="0" class="htmlgrid">
                        <tr>
                            <td>选项
                            </td>
                            <td>
                                <asp:DropDownList ID="tb_Item" runat="server">
                                    <asp:ListItem Text="A" Value="A"></asp:ListItem>
                                    <asp:ListItem Text="B" Value="B"></asp:ListItem>
                                    <asp:ListItem Text="C" Value="C"></asp:ListItem>
                                    <asp:ListItem Text="D" Value="D"></asp:ListItem>
                                    <asp:ListItem Text="E" Value="E"></asp:ListItem>
                                    <asp:ListItem Text="F" Value="F"></asp:ListItem>
                                </asp:DropDownList>                          
                                <asp:TextBox ID="tb_ItemTitle" runat="server" Columns="50"></asp:TextBox>
                            </td>
                            <td>
                                <asp:LinkButton ID="Button2" runat="server" CssClass="easyui-linkbutton" OnClick="Button2_Click">添加</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:GridView ID="GridView1" runat="server" Width="80%">
                                <Columns>
                                    <asp:BoundField DataField="VITEMCODE" HeaderText="序号" ItemStyle-Width="40" />
                                    <asp:BoundField DataField="VITEMTITLE" HeaderText="选项" />
                                </Columns>
                            </asp:GridView>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </li>
        </ul>
        <div class="ssec-group-bottom ssec-group-hasicon">
            <asp:LinkButton ID="Button1" runat="server" CssClass="easyui-linkbutton" OnClick="Button1_Click"
                OnClientClick="editor.sync();return $('#form1').form('validate')&&confirm('确认提交吗？');">提交</asp:LinkButton>
        </div>
    </div>
    <div id="rcv_users" class="easyui-window" closed="true" modal="true" title="人员列表"
        style="width: 180px; height: 500px;">
        <ul id="tt2"></ul>
        <a href="#" onclick="closelist();" class="easyui-linkbutton">确定</a>
    </div>
</asp:Content>
